﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="UserSetup.aspx.cs"
    Inherits="RCREEE.Web.UserSetup" Culture="auto" meta:resourcekey="PageResource1"
    UICulture="auto" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor"
    TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>User Setup</title>
    <style>
        .listClass
        {
        }
        .ListDiv
        {
            background-color: #fff0f0;
            height: 40em;
            padding: 1.5em 1.5em 0 1.5em;
        }
        .style1
        {
            color: #333333;
        }
        .style2
        {
            width: 128px;
        }
        .style3
        {
            width: 193px;
        }
    </style>
    <script type="text/javascript">
        $().ready(function () {
            $('#dialogContent').dialog({
                autoOpen: false,
                modal: true,
                bgiframe: true,
                title: "Confirm Delete",
                width: 300,
                height: 200
            });
        });

        function openDeletePopup(uniqueID) {
            $('#dialogContent').dialog('option', 'buttons',
                {
                    "OK": function () { __doPostBack(uniqueID, ''); $(this).dialog("close"); },
                    "Cancel": function () { $(this).dialog("close"); }
                });

            $('#dialogContent').dialog('open');

            return false;
        }

    </script>
    <div id="header">
        <div id="section">
            <table width="100%">
                <tr>
                    <td width="20%" align="center" valign="middle">
                        <img src="Images/LogoRCREEE_Transparent.png" width="200px" />
                    </td>
                    <td width="60%" align="center" valign="middle">
                        <img src="Images/areeed-ba-txtr.png" width="600px" />
                    </td>
                    <td width="25%" align="center" valign="top">
                        <img src="Images/las-logo.png" width="85px" />
                    </td>
                </tr>
            </table>
        </div>
        <ul>
            <li><a href="Default.aspx">Home</a></li>
            <li><a href="Index.aspx">Index</a></li>
            <li><a href="Topics.aspx">Topics</a></li>
            <li><a href="CountrySelector.aspx">Countries</a></li>
            <li><a href="Aboutus.aspx">About Us</a></li>
            <li><a href="contactus.aspx">Contact us</a></li>
        </ul>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="dialogContent" style="font-size: small">
        <p>
            Are you sure you want to delete?</p>
    </div>
    <center>
        <div runat="server">
            <asp:ToolkitScriptManager runat="server" ID="scriptManager" CombineScripts="True" />
            <asp:UpdateProgress ID="Up1" runat="Server" AssociatedUpdatePanelID="updatePanel1">
                <ProgressTemplate>
                    <div class="progressBackgroundFilter">
                    </div>
                    <div class="processMessage">
                        Loading...<br />
                        <br />
                        <img alt="Loading..." src="Images/Loading.gif" />
                    </div>
                </ProgressTemplate>
            </asp:UpdateProgress>
            <asp:UpdatePanel ID="updatePanel1" runat="server">
                <ContentTemplate>
                    <table runat="server" dir="<%$ Resources:Dir %>">
                        <tr>
                            <td style="background-color: #FFD700; width: 30%; text-align: top;">
                                <div align="left" style="width: 100%; height: 300px; text-align: top;">
                                    <asp:ListBox runat="server" ID="listUsers" DataTextField="Name" DataValueField="ID"
                                        CssClass="listClass" OnSelectedIndexChanged="ListUsers_SelectedIndexChanged"
                                        AutoPostBack="True" meta:resourcekey="listUsersResource1" Width="100%" Height="100%" />
                                </div>
                            </td>
                            <td style="background-color: #EEEEEE; width: 70%">
                                <table>
                                    <tr>
                                        <td>
                                            <div style="background-color: #8F8F8F; text-align: top; height: 24px; width: 100%">
                                                <div style="float: left; background-color: #8F8F8F;">
                                                    <asp:Label runat="server" ID="lblUserData" Text="User Data" meta:resourcekey="lblUserDataResource1" />
                                                </div>
                                                <div style="float: right; background-color: #8F8F8F;">
                                                    <asp:Button runat="server" ID="btnNew" Text="Create New" OnClick="BtnNew_Clicked"
                                                        meta:resourcekey="btnNewResource1" />
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div>
                                                <table>
                                                    <tr>
                                                        <td class="style3">
                                                            <asp:Label runat="server" ID="lblUserName" Text="Full Name:" meta:resourcekey="lblFullNameResource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox runat="server" ID="txtFullName" meta:resourcekey="txtFullNameResource1" />
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFullName"
                                                                Text="*" meta:resourcekey="RequiredFieldValidator4Resource1" ValidationGroup="groupSaveValidation" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="style3">
                                                            <asp:Label runat="server" ID="lblPhoneNumber" Text="Phone Number:" meta:resourcekey="lblPhoneNumberResource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox runat="server" ID="txtPhoneNumber" meta:resourcekey="txtPhoneNumberResource1" />
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtPhoneNumber"
                                                                Text="*" meta:resourcekey="RequiredFieldValidator1Resource1" ValidationGroup="groupSaveValidation" />
                                                            <asp:FilteredTextBoxExtender runat="server" TargetControlID="txtPhoneNumber" FilterType="Numbers" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="style3">
                                                            <asp:Label runat="server" ID="lblMobileNumber" Text="Mobile Number:" meta:resourcekey="lblMobileNumberResource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox runat="server" ID="txtMobileNumber" meta:resourcekey="txtMobileNumberResource1" />
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtMobileNumber"
                                                                Text="*" meta:resourcekey="RequiredFieldValidator2Resource1" ValidationGroup="groupSaveValidation" />
                                                            <asp:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="txtMobileNumber"
                                                                FilterType="Numbers" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="style3">
                                                            <asp:Label runat="server" ID="lblEmail" Text="Email:" meta:resourcekey="lblEmailResource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox runat="server" ID="txtEmail" meta:resourcekey="txtEmailResource1" />
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtEmail"
                                                                Text="*" meta:resourcekey="RequiredFieldValidator3Resource1" ValidationGroup="groupSaveValidation" />
                                                            <asp:RegularExpressionValidator ID="valRegExEmail" runat="server" ControlToValidate="txtEmail"
                                                                Text="*" ErrorMessage="Please give a valid email address" ValidationGroup="groupSaveValidation"
                                                                ValidationExpression="^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z\.][a-zA-Z]{1,3}$"></asp:RegularExpressionValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="style3">
                                                            <asp:Label runat="server" ID="Label1" Text="User Name:" meta:resourcekey="lblUserNameResource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox runat="server" ID="txtUserName" meta:resourcekey="txtEmailResource1" />
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtUserName"
                                                                Text="*" meta:resourcekey="RequiredFieldValidator3Resource1" ValidationGroup="groupSaveValidation" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="style3">
                                                            <asp:Label runat="server" ID="lblPassword" Text="Password:" meta:resourcekey="lblPasswordResource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox runat="server" ID="txtPassword" TextMode="Password" meta:resourcekey="txtEmailResource1" />
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtPassword"
                                                                Text="*" meta:resourcekey="RequiredFieldValidator3Resource1" ValidationGroup="groupSaveValidation" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="style3">
                                                            <asp:Label runat="server" ID="lblConfirmPassword" Text="Confirm Password:" meta:resourcekey="lblConfirmPasswordResource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox runat="server" ID="txtConfirmPassword" TextMode="Password" meta:resourcekey="txtEmailResource1" />
                                                            <asp:CompareValidator ID="CompareValidator1" runat="server" Text="*" ErrorMessage="Password doesn't match"
                                                                ControlToCompare="txtPassword" ControlToValidate="txtConfirmPassword" ValidationGroup="groupSaveValidation" />
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtConfirmPassword"
                                                                Text="*" meta:resourcekey="RequiredFieldValidator3Resource1" ValidationGroup="groupSaveValidation" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="style3">
                                                            <asp:Label runat="server" ID="lblIsAdmin" Text="Adminstrator:" meta:resourcekey="lblIsAdminResource1" />
                                                        </td>
                                                        <td>
                                                            <asp:CheckBox runat="server" ID="chkIsAdmin" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="style3">
                                                            <asp:Button runat="server" ID="btnSave" Text="Save" OnClick="BtnSave_Clicked" meta:resourcekey="btnSaveResource1"
                                                                ValidationGroup="groupSaveValidation" />
                                                        </td>
                                                        <td>
                                                            <asp:Button runat="server" ID="btnDelete" Text="Delete" OnClick="Delete_Clicked"
                                                                OnClientClick="javascript:return openDeletePopup(this.name);" meta:resourcekey="btnDeleteResource1" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div style="width: 100%">
                                                <asp:GridView runat="server" ID="gridPermisions" DataKeyNames="PermisionId" AutoGenerateColumns="False"
                                                    ForeColor="#333333" GridLines="None" CssClass="style1" Width="100%" OnRowDataBound="GridPermisions_RowDataBound"
                                                    EnableModelValidation="True" meta:resourcekey="gridPermisionsResource1">
                                                    <Columns>
                                                        <asp:TemplateField HeaderText="Country" meta:resourcekey="TemplateFieldResource1">
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" ID="lblItemValue" Text='<%# Eval("Country.Name") %>' meta:resourcekey="lblItemValueResource1" />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Can Add" meta:resourcekey="TemplateFieldResource2">
                                                            <ItemTemplate>
                                                                <asp:CheckBox runat="server" ID="chkAdd" meta:resourcekey="chkAddResource1" />
                                                            </ItemTemplate>
                                                            <HeaderTemplate>
                                                                <asp:Label runat="server" Text="<%$ Resources:TemplateFieldResource2.HeaderText %>" />
                                                                <asp:CheckBox ID="chkHeaderAdd" runat="server" OnCheckedChanged="ChkHeaderAdd_CheckedChanged"
                                                                    AutoPostBack="true" />
                                                            </HeaderTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Can Update" meta:resourcekey="TemplateFieldResource3">
                                                            <ItemTemplate>
                                                                <asp:CheckBox runat="server" ID="chkUpdate" meta:resourcekey="chkUpdateResource1" />
                                                            </ItemTemplate>
                                                            <HeaderTemplate>
                                                                <asp:Label ID="Label3" runat="server" Text="<%$ Resources:TemplateFieldResource3.HeaderText %>" />
                                                                <asp:CheckBox ID="chkHeaderUpdate" runat="server" OnCheckedChanged="ChkHeaderUpdate_CheckedChanged"
                                                                    AutoPostBack="true" />
                                                            </HeaderTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Can Delete" meta:resourcekey="TemplateFieldResource4">
                                                            <ItemTemplate>
                                                                <asp:CheckBox runat="server" ID="chkDelete" meta:resourcekey="chkDeleteResource1" />
                                                            </ItemTemplate>
                                                            <HeaderTemplate>
                                                                <asp:Label ID="Label2" runat="server" Text="<%$ Resources:TemplateFieldResource4.HeaderText %>" />
                                                                <asp:CheckBox ID="chkHeaderDelete" runat="server" OnCheckedChanged="ChkHeaderDelete_CheckedChanged"
                                                                    AutoPostBack="true" />
                                                            </HeaderTemplate>
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <FooterStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                                                    <HeaderStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                                                    <PagerStyle BackColor="#CCCCCC" ForeColor="#990000" HorizontalAlign="Center" />
                                                    <RowStyle BackColor="#EAEAEA" ForeColor="#333333" />
                                                    <SelectedRowStyle BackColor="#CCCCCC" Font-Bold="True" ForeColor="#990000" />
                                                </asp:GridView>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </center>
</asp:Content>
